From d43dea81f9135fe26e4de254ecac38a9c773ddf2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 15 Jun 2015 16:18:38 +0100 Subject: [PATCH] xl: Do not ignore unparseable PCI BDFs If xlu_pci_parse_bdf fails, abandon the domain creation, rather than blundering on. Signed-off-by: Ian Jackson CC: Andrew Cooper Acked-by: Wei Liu --- v2: Print the offending supposed-BDF too. --- tools/libxl/xl_cmdimpl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index a08c264f88..5ab4e16472 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1945,8 +1945,14 @@ skip_vfb: pcidev->power_mgmt = pci_power_mgmt; pcidev->permissive = pci_permissive; pcidev->seize = pci_seize; - if (!xlu_pci_parse_bdf(config, pcidev, buf)) - d_config->num_pcidevs++; + e = xlu_pci_parse_bdf(config, pcidev, buf); + if (e) { + fprintf(stderr, + "unable to parse PCI BDF `%s' for passthrough\n", + buf); + exit(-e); + } + d_config->num_pcidevs++; } if (d_config->num_pcidevs && c_info->type == LIBXL_DOMAIN_TYPE_PV) libxl_defbool_set(&b_info->u.pv.e820_host, true); -- 2.30.2